-
-
Notifications
You must be signed in to change notification settings - Fork 398
Extraction of library auto-detection / caching module in legacy/builder #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5a2cc3b
to
feb0437
Compare
feb0437
to
40f9e89
Compare
cmaglie
added a commit
that referenced
this pull request
Apr 8, 2020
…627) * Removed legacy utils.PrettyOSName function * Removed some constants Possibly a container structure for build properties may be defined later with helper methods (like GetBuildCorePath() ... etc.) to help in retrieving these properties. * Removed unused Context parameter * upgrade github.com/arduino/go-properties-orderedmap to v1.0.0
40f9e89
to
ec36bd8
Compare
ec36bd8
to
e3a1a68
Compare
facchinm
approved these changes
May 8, 2020
e3a1a68
to
d6097ff
Compare
Also added methods to Load and Save the cache from disk without the need to pass cacheFilePath back and forth.
…ner_find_includes.go There is no point in keeping those structures inside module types because: - they are used only in 'container_find_includes.go' - the entry in Context is used only in for library discovery This commit prepares for the extraction of the library discovery logic from legacy package.
- Added 'Contains(...)' method (instead of sliceContainsSourceFile(...)) - Removed useless comparators
All the fields needed to perform library discovery have been moved into the CppIncludeFinder so there is no more need to pass them around as parameters making it much more lightweight.
Previously the Origin interface{} field was used to store the "origin" of the source file (being sketch or library). Actually Origin is really needed only to reconstruct BuildPath and RootPath when the origin is a Library, in all the other cases we can reconstruct BuildPath and RootPath looking inside Context. With the above in mind, this commit removes the non-idiomatic interface{} by replacing it with a Library, so now the meaning of the SourceFile.Library field is "the library where the source file is contained or nil if not part of a library".
I don't know the reason why it was not placed here already, the git log doesn't give much hints. Anyway this change prepares for the next commit where the Library field is being removed from SourceFile struct.
This is a series of commit to make library detection context-agnostic. In this commit the IncludeFolders usage has been removed from the internal logic, a new field CppIncludesFinder.IncludeDirsFound has been made for this purpose. The new field is setup before by the caller before doing the actual discovery.
d6097ff
to
23d781f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to extract the library auto-detection logic out of the
legacy/builder
and move it into thearduino
module. This is all preparation work to decouple the algorithm from the legacy builder.The most difficult part is finding a meaningful "boundaries" for this module becuase at the moment it's very tied to the ex-builder context, BTW I think it's 90% done, the last piece that prevents the extraction of the module is the ctx.Logger() part, but this requires another, bigger, refactoring and integration with the Java IDE.
@matthijskooijman